error.tsx 845 B

123456789101112131415161718192021222324252627282930313233343536
  1. "use client";
  2. import { useEffect } from "react";
  3. import { useT } from "@/components/locale-provider";
  4. export default function Error({
  5. error,
  6. reset,
  7. }: {
  8. error: Error;
  9. reset: () => void;
  10. }) {
  11. const t = useT().error;
  12. useEffect(() => {
  13. console.error(error);
  14. }, [error]);
  15. return (
  16. <div className="flex min-h-[60vh] flex-col items-center justify-center gap-4 px-4 text-center">
  17. <p className="eyebrow">{t.eyebrow}</p>
  18. <h1 className="font-display text-4xl font-semibold tracking-[-0.015em]">
  19. {t.title}
  20. </h1>
  21. <button
  22. className="lg mt-2 inline-flex h-10 items-center rounded-full px-5 text-sm font-medium"
  23. type="button"
  24. onClick={() => reset()}
  25. >
  26. <span aria-hidden className="lg-caustic" />
  27. <span>{t.retry}</span>
  28. </button>
  29. </div>
  30. );
  31. }